package com.gking.centerSystem.entity;


import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * ip 访问策略
 */
@Data
@TableName("access_policy")
public class AccessPolicy implements Serializable {

    private static final long serialVersionUID = 1L;

    //主键id
    @TableId
    private String id;

    //策略名称
    @TableField(value = "policyName")
    private String policyName;

    //策略描述
    @TableField(value = "description")
    private String description;

    //策略类型 （白名单、黑名单、灰名单、频率访问控制等）
    @TableField(value = "policyType")
    private String policyType;

    //策略详细信息 JSON字符串（如角色，时间段，地理位置等）
    @TableField(value = "detail")
    private String detail;

    //权重（数字越大，权重越高）
    @TableField(value = "weight")
    private Integer weight;

    //允许某个时间段某个 IP 被拒绝访问的次数
    @TableField(value = "allowRejectionCount")
    private Integer allowRejectionCount;

    //允许某个 IP 一天被拒绝访问的次数总和
    @TableField(value = "allowRejectionTotal")
    private Integer allowRejectionTotal;

    //是否启用 0启用，1禁用
    @TableField(value = "enable")
    private Integer enable;

    //是否删除 0存在，1删除
    @TableField(value = "isDelete")
    private Integer isDelete;

    //创建时间
    @TableField(value = "createTime", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    //创建者id
    @TableField(value = "createUserId", fill = FieldFill.INSERT)
    private String createUserId;

    //更新时间
    @TableField(value = "updateTime", fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    //更新者id
    @TableField(value = "updateUserId", fill = FieldFill.UPDATE)
    private String updateUserId;

    //删除时间
    @TableField(value = "deleteTime")
    private LocalDateTime deleteTime;

    //删除者id
    @TableField(value = "deleteUserId")
    private String deleteUserId;

}
